<template>
  <div>
    <div id="div_title">
      <span id="title" v-if="this.prescription.checked_status == 2"><b>处方单状态：审核中</b></span>
      <span id="title" v-if="this.prescription.checked_status == 1"><b>处方单状态：审核通过</b></span>
      <span id="title" v-if="this.prescription.checked_status == 0"><b>处方单状态：审核未通过</b></span>
      <el-button type="primary" id="back" @click="back()">返回</el-button>
    </div>
    <PrescriptionUserMessage :prescription="prescription"></PrescriptionUserMessage>
    <PrescriptionMessage :prescription="prescription"></PrescriptionMessage>
  </div>
</template>

<script>
import PrescriptionUserMessage from "./PrescriptionUserMessage.vue"
import PrescriptionMessage from "./PrescriptionMessage.vue"
export default {
  name: "PrescriptionDetail",
  components: {
    PrescriptionUserMessage,
    PrescriptionMessage
  },
  // props: {
  //   prescription: ''
  // },
  data () {
    let json = window.sessionStorage.getItem("prescription");
    let prescription = window.JSON.parse(json);
    return {
      prescription: prescription
    }
  },
  methods: {
    back: function () {
      this.$router.push("/index/prescription")
    }
  }
}
</script>

<style scoped>
#title {
  font-size: 30px;
}
#div_title {
  /* border: 1px solid rgb(216, 216, 216); */
  margin-right: 200px;
}
#back {
  float: right;
  line-height: initial;
}
</style>
